/**
 * Application Application.java
 */

package CCT220_Aula18_Exercicio03_13106;


import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;


/**
 * </br>******************************
 * </br>Project: CCT220
 * </br>Package: CCT220_Aula18_Exercicio03_13106
 * </br>Class: Application
 * </br>Last Change: 28/10/2011 13:07:44 by marcel
 * </br>Description:
 * </br>******************************</br>
 * 
 * @author marcel
 * @author 13106
 * 
 */
public class Application {

	private JButton jbChoseColor;

	private JPanel  jpColorPanel;


	public Application() {

		this.startComponents();
		JFrame jf = new JFrame("MArcel M. Grilo - 13106");
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.setSize(200, 100);
		jf.add(jpColorPanel);
		jf.setVisible(true);

	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula18_Exercicio03_13106
	 * </br>Class: Application
	 * </br>Method: startComponents
	 * </br>Last Change: 28/10/2011 13:11:36 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 */
	private void startComponents() {

		jpColorPanel = new JPanel();
		jbChoseColor = new JButton("Escolher Cor");
		jbChoseColor.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {

				Color c = JColorChooser.showDialog(null, "Paleta de cores",
				        jpColorPanel.getBackground());
				jpColorPanel.setBackground(c);
				jpColorPanel.repaint();
			}
		});
		jpColorPanel.add(jbChoseColor);

	}


	public static void main(String[] args) {

		new Application();

	}
}
